<ul class="sidebar-menu">

    <li ng-repeat="(m1index,m1) in menus" ng-class="{active:selectedIndexes[0]==m1index}">
        <a href="javascript:;">
            <i class="oc-partial-icon icm {{m1.iconClass}}"></i>
            <span>{{m1.menuName}}</span>
            <i ng-if="m1.leaf != 1" class="fa fa-angle-left pull-right"></i>
        </a>

        <ul ng-if="m1.leaf != 1" ng-class="{'treeview-menu':m1.leaf != 1}">

            <li ng-repeat="(m2index,m2) in m1.children" ng-class="{active:selectedIndexes[0]==m1index&&selectedIndexes[1]==m2index}">
                <a href="javascript:;" ng-click="pathTo(m1index+'_'+m2index,m2.leaf)">>
                    <i class="oc-partial-icon icm"></i>
                    <span>{{m2.menuName}}</span>
                    <i ng-if="m2.leaf != 1" class="fa fa-angle-left pull-right"></i>
                </a>

                <ul ng-if="m2.leaf != 1"  ng-class="{'treeview-menu':m2.leaf != 1}">

                    <li ng-repeat="(m3index,m3) in m2.children"
                        ng-class="{active:selectedIndexes[0]==m1index&&selectedIndexes[1]==m2index&&selectedIndexes[2]==m3index}">
                        <a href="javascript:;" ng-click="pathTo(m1index+'_'+m2index+'_'+m3index,m3.leaf,{'param':m3.templateUrl})">
                            <i>&nbsp;</i>
                            <span>{{m3.menuName}}</span>
                        </a>
                    </li>

                </ul>
            </li>

        </ul>

    </li>

</ul>